﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace WebsocketApp
{
    class Program
    {
        async static Task Main(string[] args)
        {
            var ws = WebsocketNode.CreateInstance();
            while (true)
            {
                var ret = await ws.Connect("ws://127.0.0.1:19002/ws");
                if (ret)
                {
                    for (var i = 0; i < 30; i++)
                    {
                        await Task.Delay(500);
                        await ws.SendWingbotMessage(202, new List<NavigationTaskItem>());
                    }
                }
                Console.WriteLine("Exit Program.");
                await ws.Close();
            }
        }

        static void Wait()
        {
            while (true)
            {
                Thread.Sleep(10);
            }
        }
    }
}
